package com.yc.dao;

import java.util.List;
import java.util.Map;

/**
 *
 * @author UNO
 * 2021年7月7日下午2:24:18
 */
public class UserControlDao {
	public List<Map<String, String>> finds(String account){
		DBHelper db = new DBHelper();
		String sql = "select u_id,u_name, u_email,u_cardid, u_tel, u_status from tb_user where u_name =  ? ";
		return db.finds(sql, account);
	}
	/**
	 * 查询所有用户
	 * @return
	 */
	public List<Map<String, String>> finds(){
		DBHelper db = new DBHelper();
		String sql = "select u_id, u_name, u_email, u_cardid, u_tel, u_status from tb_user";
		return db.finds(sql);
	}
	/**
	 * 改变用户的状态
	 * @param account
	 * @param status
	 * @return
	 */
	public int update(int status , String account) {
		DBHelper db = new DBHelper();
		String sql = "update tb_user set u_status = ? where u_name = ?";
		return db.update(sql, status , account);
	}
}
